<%@ page import="com.imooc.sm.entity.Staff" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=8">
    <title>左边导航</title>
    <%


        //管理员
        boolean flag = false;

        //超级管理员
        boolean superFlag = false;

        Staff user = (Staff) session.getAttribute("USER");
        String userForStatus = user.getStatus();
        if (userForStatus.equals("超级管理员")) {
            flag = true;
            superFlag = true;
        } else if (userForStatus.equals("管理员")) {
            flag = true;
        }

    %>
    <link rel="stylesheet" type="text/css" href="${basePath}css/reset.css"/>
    <link rel="stylesheet" type="text/css" href="${basePath}css/common.css"/>
    <script type="text/javascript" src="${basePath}js/jquery-1.8.3.min.js"></script>
    <!--框架高度设置-->
    <script type="text/javascript">
        $(function () {
            $('.sidenav li').click(function () {
                $(this).siblings('li').removeClass('now');
                $(this).addClass('now');
            });

            $('.erji li').click(function () {
                $(this).siblings('li').removeClass('now_li');
                $(this).addClass('now_li');
            });

            var main_h = $(window).height();
            $('.sidenav').css('height', main_h + 'px');
        })
    </script>
    <!--框架高度设置-->


</head>

<body>
<div id="left_ctn">
    <ul class="sidenav">
        <% if (flag == true) {%>
        <li>
            <div class="nav_m">
                <span><a>人员管理</a></span>
                <i>&nbsp;</i>
            </div>
            <ul class="erji">
                <li>
                    <span><a href="staff/list.do" target="main">员工管理</a></span>
                </li>
                <li>
                    <span><a href="department/list.do" target="main">部门管理</a></span>
                </li>
            </ul>
        </li>
        <% if (superFlag == true) {%>
        <li>
            <div class="nav_m">
                <span><a>用户权限</a></span>
                <i>&nbsp;</i>
            </div>
            <ul class="erji">
                <li>
                    <span><a href="power/list.do" target="main">角色设置</a></span>
                </li>
                <li>
                    <span><a href="power/toText.do" target="main">功能权限</a></span>
                </li>
            </ul>
        </li>
        <li>
            <div class="nav_m">
                <span><a>日志信息</a></span>
                <i>&nbsp;</i>
            </div>
            <ul class="erji">
                <li>
                    <span><a href="log/operationLog.do" target="main">操作日志</a></span>
                </li>
                <li>
                    <span><a href="log/loginLog.do" target="main">登陆日志</a></span>
                </li>
                <li>
                    <span><a href="log/systemLog.do" target="main">系统日志</a></span>
                </li>
            </ul>
        </li>
        <% }
        }%>
        <li class="now">
            <div class="nav_m">
                <span><a>个人中心</a></span>
                <i>&nbsp;</i>
            </div>
            <ul class="erji">
                <li>
                    <span><a href="self/info.do" target="main">个人信息</a></span>
                </li>
                <li>
                    <span><a href="self/toChangePassword.do" target="main">修改密码</a></span>
                </li>
            </ul>
        </li>
        <li>
            <div class="nav_m">
                <span><a href="toLogin.do" target="_top">退出系统</a></span>
            </div>
        </li>
    </ul>
</div>
</body>
</html>
